package com.lykj.llw.box.adapter

import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.lykj.lib_base.component.GlideApp
import com.lykj.llw.box.R
import com.lykj.llw.box.data.bean.response.MyGiftBagListResponse

/**
 * ================================================
 * 我的礼包列表适配器
 * ================================================
 *
 * @author gosha
 * @date 2023/10/17-14:42
 */
class MyGiftBagAdapter:BaseQuickAdapter<MyGiftBagListResponse.DataDTO,BaseViewHolder>(R.layout.item_my_gift_bag) {
    override fun convert(holder: BaseViewHolder, item: MyGiftBagListResponse.DataDTO) {
        holder.setText(R.id.tv_gift_name,"#礼包")
        holder.setText(R.id.tv_role_name,"${item.gamename}")
        holder.setText(R.id.tv_gift_code,"礼包码：${item.card}")

        GlideApp.with(context)
            .load(item.icon)
            .transition(DrawableTransitionOptions.withCrossFade())
            .into(holder.getView(R.id.iv_icon))
    }
}